const http = require('http')

// 1. 引入 url 模块
const url = require('url')

const server = http.createServer((request, response) => {
    response.setHeader('content-type', 'text/html;charset=utf-8')

    // 2. 实例化一个 URL 对象
    let url = new URL(request.url,'http://127.0.0.1')
    console.log(url.searchParams.get('password'))

    // 3. 访问路径 http://127.0.0.1:9090/seach?username=1&password=1


    response.end('hello')

})
server.listen(9090, () => {
    console.log('服务启动')
})